#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int a = 0;
	int count = 0;
	scanf("%d", &a);
	while (a)	
	{
		count++;
		a = a & (a - 1);
	}
	printf("%d", count);
	return 0;
}

//11111000
//11110111  11110000
//11101111  11100000
//11011111  11000000
//
//void test2()
//{
//	printf("hehe\n");
//}
//void test1()
//{
//	test2();
//}
//void test()
//{
//	test1();
//}
//int main()
//{
//	test();
//	return 0;
//}